package com.atguigu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("error")
public class ErrorController {
    @GetMapping("data1")
    public String data1(){
       String name = null;
       name.toString();
       return "null point exception !!";
    }
    @GetMapping("data2")
    public String data2(){
        System.out.println("by zero exception");
        int i = 1/0;
        return "by zero exception !!!";
    }
    @GetMapping("data3")
    public String data3(){
        System.out.println("success");
        return "success";
    }
}
